import { http } from "@/utils/http";

export type commonResult<T> = {
  code: number;
  msg: string;
  result: T;
};

export type infoType = {

	projectId?: number,
  projectName?: string,
	buildingName?: string,
	upFloors?: number,
	downFloors?: number,
	drawingPoint?: any,
	markPoint?:any,
  lat?:any,
  lng?:any,
  area?:any,
	remark?: string,
}
export type infoTypeList = {
  data: infoType[];
  total: number;
};

const List = '/business/project/v2/buildings';
const Url = '/business/project/v2/building';
export const getList = (params?: object) => {
  return http.request<commonResult<infoTypeList>>("get", List, {
    params
  });
};
export const getInfo = (params?: object) => {
  return http.request<commonResult<infoType>>("get", Url, {
    params
  });
};
export const addInfo = (data?: object) => {
  return http.request<commonResult<any>>("post", Url, {
    data
  });
};
export const editInfo = (data?: object) => {
  return http.request<commonResult<any>>("put", Url, {
    data
  });
};
export const deleteInfo = (data?: object) => {
  return http.request<commonResult<any>>("delete", Url, {
    data
  });
};

/** 下拉框 */
export const getbuildSelectList = (params?: object) => {
  return http.request<commonResult<Array<any>>>("get", '/business/project/v2/build', {
    params
  });
}

/** 下拉框 */
export const getfloorSelectList = (params?: object) => {
  return http.request<commonResult<Array<any>>>("get", '/business/project/drawing/v2/draw', {
    params
  });
}

/**获取建筑已经标记过的点位 */

export const allPoints = (params?: object) => {
  return http.request<commonResult<Array<any>>>("get", '/business/project/v2/map-point', {
    params
  });
}
/**2.5.6.7获取设施已标记的点位（地图和图纸） */

export const allfacilitPoints = (params?: object) => {
  return http.request<commonResult<Array<any>>>("get", '/business/project/facilit/v2/map-point', {
    params
  });
}
/**2.8.1.6获取已标记的点位（地图和图纸） */

export const allPointsVideo = (params?: object) => {
  return http.request<commonResult<Array<any>>>("get", '/business/device/monitor/v2/map-point', {
    params
  });
}

/**2.8.2.19获取已标记的点位（地图和图纸）设备 */

export const allPointsDevice = (params?: object) => {
  return http.request<commonResult<Array<any>>>("get", '/business/device/device/v2/map-point', {
    params
  });
}